package gat.common.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * 系统消息模板枚举类
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum MessageTemplateEnum {
    /**
     * 模板编码对应的枚举类，注释为该模板所需要的参数以及描述
     * value：模板编码
     * code:模板code
     * desc：模板描述
     */
    /**
     * 系统消息模板
     */

    //卡密商品支付成功
    KM_PAY_SUCCESS_NOTIFICATION("MSG_20230103114715826001","卡密商品支付成功通知"),

    //充值商品支付成功
    CZ_PAY_SUCCESS_NOTIFICATION("MSG_20230103114718828002","充值商品支付成功通知"),

    //待支付订单即将关闭
    WAIT_PAY_ORDER_NOTIFICATION("MSG_20230103114720740003","待支付订单即将关闭通知"),

    //售后成功通知
    SALE_SUCCESS_NOTIFICATION("MSG_20230103114729814004","售后成功通知"),

    //售后拒绝通知
    SALE_REFUSE_NOTIFICATION("MSG_20230103114731346005","售后拒绝通知"),

    //提现成功通知
    WITHDRAW_SUCCESS_NOTIFICATION("MSG_20230103114731346008","提现成功通知"),

    //邀请好友成功注册通知
    INVITE_REGISTER_NOTIFICATION("MSG_20230103114731346007","邀请好友成功注册通知"),

    //提现拒绝通知
    WITHDRAW_REFUSE_NOTIFICATION("MSG_20230103114733043006","提现拒绝通知"),

    // 超时支付退款通知
    OUT_TIME_PAY_NOTIFICATION("MSG_20230503114720740003","超时支付退款通知"),

    MESSAGE("MSG_20230103114731346007","后台平台交易消息通知"),
    ;


    //模板编码
    private String value;
    //数据库对应的模板code
    //模板描述
    private String desc;


    public static MessageTemplateEnum getByValue(String value) {
        for (MessageTemplateEnum messageTemplateEnum : values()) {
            if (messageTemplateEnum.getValue().equals(value)) {
                return messageTemplateEnum;
            }
        }
        return null;
    }
}
